<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var t1=new Promise((resolve)=>{
            setTimeout(()=>{
                resolve("100")
            },1000)
        })
        var t2=new Promise((resolve)=>{
            setTimeout(()=>{
                resolve("200")
            },1000)
        })
        var t3=new Promise((resolve)=>{
            setTimeout(()=>{
                resolve("300")
            },1000)
        })
        var arr=[t1,t2,t3];
        // forEach 不支持异步循环
        /* arr.forEach(async item=>{
            var res =await item;
            console.log(res);
        }) */

        (async()=>{
            for(let item of arr){
                let res=await item;
                console.log(res);
            }
        })();
    </script>
</body>
</html>